//
//  ThirdViewController.m
//  UI_Homework_02
//
//  Created by 黄威 on 16/5/11.
//  Copyright © 2016年 黄威. All rights reserved.
//

#import "ThirdViewController.h"

@interface ThirdViewController ()

@end

@implementation ThirdViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"欢迎页";
    
    UIButton *button = [[UIButton alloc]initWithFrame:CGRectMake(120, 220, 100, 60)];
    [button setTitle:@"返回" forState: UIControlStateNormal];
    button.backgroundColor = [UIColor purpleColor];
    
    [self.view addSubview:button];
    [button addTarget:self action:@selector(handle) forControlEvents:UIControlEventTouchUpInside];
    [button release];
    
    UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(140, 120, 100, 60)];
    label.text = @"Welcome!";
    [self.view addSubview:label];
    self.view.backgroundColor = [UIColor cyanColor];
    
}

- (void)handle{

    [self.navigationController popViewControllerAnimated:YES];


}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
